#! /bin/bash

menu=$(zenity --width 120 --height 320 --list \
  --title="Shutting down..." \
  --column 'Option'\
    Poweroff  \
    Reboot    \
    Suspend   \
    "Back to KWin X11")

case $menu in
    "Poweroff")   loginctl poweroff ;;
    "Reboot")     loginctl reboot ;;
    "Suspend")    /home/sny/.xmonad/sh/lock.sh | loginctl suspend ;;
    "Back to KWin X11")
        killall xmonad-x86_64-linux
        killall picom
        sleep 0.5s
        kquitapp5 plasmashell
        kstart5 plasmashell
        sleep 0.5s
        qdbus org.kde.kglobalaccel /kglobalaccel blockGlobalShortcuts false
        kwin_x11 &
    ;;
esac
